﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace http服务
{
    class Program
    {
        static void Main(string[] args)
        {
            //服务线程
            System.Threading.Tasks.Task.Factory.StartNew(() =>
            {
                HttpServer server = new HttpServer();
                server.Start();
            });
            System.Threading.Tasks.TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;

            while (true) { Console.Read(); }
           

        }

        static void TaskScheduler_UnobservedTaskException(object sender, UnobservedTaskExceptionEventArgs e)
        {
            e.SetObserved();
            Console.WriteLine(e.Exception!=null?e.Exception.ToString():string.Empty);
        }


    }
}
